//
//  OSetUserInfo.m
//  OFootball
//
//  Created by Hauler Lord on 15/9/23.
//  Copyright (c) 2015年 上官千城. All rights reserved.
//

#import "OSetUserInfo.h"

@implementation OSetUserInfo
-(instancetype) initWithCallBack:(SEL)callBack for:(NSObject *)recvObjc
{
    return [super initWithName:@"OSetUserInfo" recvObjc:recvObjc callBack:callBack];
}


-(void) request
{
    NSDictionary* params = @{@"nick":self.nick,@"zone":self.zone,@"sex":self.sex,@"signature":self.signature
                             };
    
    [self send:params];
}

-(void) run:(NSData *)data erc:(NSInteger)erc
{
    if (erc != SUCC) {
        //TODO:fail logic process;
        NSString *str = [NSString stringWithFormat:@"更新失败erc= %ld",(long)erc];
        UIAlertView *failAlert = [[UIAlertView alloc] initWithTitle:@"提示" message:str delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
        [failAlert show];
        return;
    }
    
    NSDictionary* dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
  
    
    NSLog(@"setUserInfo == %@",dic);
    
    [self setValuesForKeysWithDictionary:dic];
    
    
    //TODO:succ logic process;
    /* if (muDelegate) {
     muDelegate(self);
     }*/
    [self mu];
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{


}

@end
